package com.itany.corejava.code07_面向对象.继承;

import javax.security.auth.login.AccountNotFoundException;
import java.security.GeneralSecurityException;

/**
 * @author 石小俊
 * @date 2023年04月19日 15:13
 */
public class MotorVehicle {
    private String no; // 车牌号
    private String brand; // 品牌

    void show() {
        System.out.println("我是机动车");
    }

    public void showBrand() {
        System.out.println("这是一辆" + brand + "牌的机动车");
    }

}

class Car extends MotorVehicle {
    private String type; // 型号

    public void show() {
        System.out.println("我是小轿车");
    }

    public void showBrand(int i) {
        System.out.println("这是小轿车");
    }
}

class Bus extends MotorVehicle {
    private int seatCount; // 座位数

    public void show() {
        System.out.println("我是公共汽车");
    }
}

class TestMotorVehicle {
    public static void main(String[] args) {
        Car car = new Car();
        car.show();
        Bus bus = new Bus();
        bus.show();
        MotorVehicle motorVehicle = new MotorVehicle();
        motorVehicle.show();

        car.showBrand();
        car.showBrand(1);
    }
}
